﻿#region Copyright Notice
// 
// 
//  
//  Copyright (c) 2009-2011 Anindya Chatterjee
//  
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.apache.org/licenses/LICENSE-2.0
//  
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// 
// 
#endregion
using System;

namespace AbstractClass.Threading.Tasks
{
    /// <summary>
    /// Provides data for the execution of a <see cref="Job&lt;TResult&gt;"/> upon completion.
    /// </summary>
    /// <typeparam name="TResult">The type of the result.</typeparam>
    public class JobCompletedEventArgs<TResult> : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="JobCompletedEventArgs&lt;TResult&gt;"/> class.
        /// </summary>
        /// <param name="job">The job associated with an event.</param>
        /// <param name="result">The result of the operation.</param>
        public JobCompletedEventArgs(Job<TResult> job, TResult result)
        {
            JobId = job.JobId;
            Result = result;
        }

        /// <summary>
        /// Gets the unique id of the job associated with an event.
        /// </summary>
        /// <value>The unique job id.</value>
        public String JobId { get; private set; }

        /// <summary>
        /// Gets the result of the operation.
        /// </summary>
        /// <value>The result of the operation.</value>
        public TResult Result { get; private set; }
    }
}